<template>
  <section>
    <banner></banner>

    <div class="div_1200">

      <div class="div_con">
        <h1>
          {{pro.name}}
        </h1>
        <div>
          <img :src="pro.pic">
        </div>
        <el-button type='primary' size='large' @click='g.back()'> 返回上一页 </el-button>
        <!-- type	类型	string	primary,success,warning,danger,info,text
                   size	尺寸	string	large,small,mini -->
        {{pro.content}}
      </div>
    </div>
  </section>
</template>
<script>
  import banner from '../../components/banner.vue';
  export default {
    data() {
      return {

      };
    },
    methods: {

    },
    mounted() {

    },
    props: {

    },
    components: {
      banner
    },
    async asyncData({
      isDev,
      route,
      store,
      env,
      params,
      query,
      req,
      res,
      redirect,
      error
    }) {

      return await new Promise((resolve, reject) => {
        store.commit("ajax", ({
          class: "pro",
          para: "getPro",
          j: {
            _id: query.proId
          },
          fun: (res) => {

            if (!res.data.err) {
              resolve({
                pro: res.data.info
              })
            } else {
              console.log(res.data.err);
            }
          }
        }))
      });
    },

  };

</script>
<style scoped>
  .div_con {
    padding: 10px;
    min-height: 600px;
  }

</style>
